using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

using SlimDX;
using SlimDX.Direct3D9;

using miciv.Rendering;

namespace miciv.Geometry
{
    public class ShapeVertex : IShapeVertex
    {
        protected Hashtable m_htblData;

        public ShapeVertex()
        {
            this.m_htblData = new Hashtable();
        }

        public void SetElement<T>(string _strName, T _data, bool _bOverwrite)
        {
            if (false == this.m_htblData.ContainsKey(_strName))
            {
                this.m_htblData.Add(_strName, _data);
            }
            else if (false != _bOverwrite)
            {
                this.m_htblData[_strName] = _data;
            }
        }

        #region IShapeVertex Members

        public T GetElement<T>(string _strName) where T : struct
        {
            if (false != this.m_htblData.ContainsKey(_strName))
            {
                return (T)this.m_htblData[_strName];
            }
            return default(T);
        }

        #endregion
    }
}
